package cn.dankal.flyaudio.personal.notificaiton

import api.UserServiceFactory
import cn.dankal.basiclib.rx.AbstractStateSubscriber
import cn.dankal.business.pojo.NotificationBean
import cn.dankal.flyaudio.personal.setting.SettingContract
import io.reactivex.disposables.Disposable

class SettingPresenter(private val type: Int?) : SettingContract.Presenter {

    var view: SettingContract.View? = null
    var page = 1

    override fun attachView(view: SettingContract.View) {
        this.view = view
    }

    override fun detachView() {
        view = null
    }

    override fun requestData() {
        about_details()
    }

    /***
     * 关于我的详情
     *
     */
    private fun about_details() {
        UserServiceFactory.about_details()
                .subscribe(object : AbstractStateSubscriber<NotificationBean>(view) {
                    override fun onNext(t: NotificationBean) {
                        super.onNext(t)
                        this@SettingPresenter.view?.render(t)
                    }
                })
    }


}